package org.vergil.core.thread.productionmessage;

import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.vergil.config.SystemConfig;

/**
 * Created by vergil on 17-3-18.
 */
public class App {
    public static void main(String[] args){
        ApplicationContext context = new AnnotationConfigApplicationContext(SystemConfig.class);
        Consumer consumer = context.getBean(Consumer.class);
        Producer producer = context.getBean(Producer.class);
        Record record = context.getBean(Record.class);

        Thread thread1 = new Thread(producer,"producer1");
        thread1.start();


        Thread consumer1 = new Thread(consumer,"consumer1");
        consumer1.start();

        Thread recodeThread = new Thread(record,"record");
        recodeThread.start();
    }
}
